var fs = require("fs");
module.exports = {
    prefix: "/file/",
    post: {
        "upload": {
            des: {
                name: "fileUpload",
                content: "文件上传",
            },
            multipart: true,
            method: function*() {
                var self = this;
                print("上传文件");
                console.log("java binary:", self.request.body);
                // console.log(self.request.body.files)
                try {
                    var file = self.request.body.files.upload || self.request.body.files.file1;
                    var _r = yield qiniuUpload(file.name, file.path);
                    self.body = _r;
                } catch (e) {
                    self.body = printError(e)
                }
            }
        }
    }
}
